<?php

declare(strict_types=1);

namespace app\validate\order;

use think\Validate;

class RefundValidate extends Validate
{
    protected $rule = [
        'order_id' => 'require|integer|gt:0',
        'order_item_id' => 'integer|gt:0',
        'apply_amount' => 'require|float|gt:0',
        'approved_amount' => 'float|egt:0',
        'buyer_amount' => 'float|egt:0',
        'seller_amount' => 'float|egt:0',
        'platform_amount' => 'float|egt:0',
        'reason' => 'max:255',
        'remark' => 'max:255',
        'action' => 'in:approve,reject,complete',
        'status' => 'in:0,1,2,3',
    ];

    protected $scene = [
        'apply' => ['order_id', 'order_item_id', 'apply_amount', 'reason'],
        'update' => ['action', 'approved_amount', 'buyer_amount', 'seller_amount', 'platform_amount', 'remark'],
    ];
}
